<?php echo $html->docType('xhtml-trans'); ?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<title>Caddy-x6tm - <?php echo $title_for_layout; ?></title>
		<?php echo $html->charset('UTF-8') ?>
		<link rel="icon" href="<?php echo $this->webroot.'favicon.ico'; ?>" type="image/x-icon" />
		<link rel="shortcut icon" href="<?php echo $this->webroot.'favicon.ico' ?>" type="image/x-icon" />
		<?php echo $html->css('x6tm'); ?>
		<?php echo $html->css('page'); ?>
		<?php echo $html->css('form'); ?>
		
		<!--[if lt IE 7.]>
			<script defer type="text/javascript" src="/js/fix/pngfix.js"></script>
		<![endif]-->
		
		<?php if(isset($javascript)): ?>
			<?php echo $javascript->link('scriptaculous/prototype'); ?>
			<?php echo $javascript->link('tiny_mce/tiny_mce'); ?>
			<?php echo $javascript->link('scriptaculous/scriptaculous.js?load=effects,dragdrop'); ?>
			<?php echo $javascript->link('scriptaculous/controls'); ?>
		<?php endif; ?>
	</head>
	<body>
		<div id="container">
			<div id="header">
			&nbsp;<h1><?php echo $html->link('..: Caddy-x6tm  :..', '/'); ?></h1>
			</div>
			
			<div id="menu-top">
					<?php echo $html->link('Home', '/') ?> | 
					<?php //echo $html->link('Voir les produits', '/products') ?> | 
					<?php //echo $html->link('Tasks', '/tasks'); ?> |
					<?php /*if(!$session->read('user')) { 
							if(isset($javascript))
							{
								echo '<a onclick="new Ajax.Updater(\'ajax\', \''.$html->url('/users/ajaxlogin').'\', {asynchrounous:true, evalScripts:true}); new Effect.BlindDown(\'ajax\');">Connexion</a>';
							}else{
								echo $html->link('Connexion', '/users/login');
							}
						} else {
							echo $html->link('Déconnexion', '/users/logout');
						}*/ ?> | 
					Welcome <?php //echo $session->read('user'); ?>
				</div>
			
				<div id="content">
					
					<?php if($session->check('Message.flash'))
						{
							$session->flash();
						} ?>
	
					<?php echo $content_for_layout;	?>
				</div>
			
				<div id="menu-left">
					<h3>Main</h3>
					<ul>
						<li><?php echo $html->link('Home', '/'); ?></li>
					</ul>
					<?php echo $this->renderElement('menu/categories', array('categories' => $categories)); ?>
					<h3>Syndication</h3>
					<ul>
						<li><?php echo $html->link('Blog Rss', '/pages/index.rss'); ?></li>
					</ul>
				</div>
				
				
				<?php if($session->read('user')) : ?>
				<div id="menu-left">
				
					<h3>Users</h3>
					<ul>
						<li><?php echo $html->link('Panier', '/customers/mybasket'); ?></li>
						<li><?php echo $html->link('Commandes', '/bills/myorder'); ?></li>
						<li><?php echo $html->link('Factures', '/bills/mybill'); ?></li>
						<li><?php echo $html->link('Profile', '/users/profile/'.$session->read('id')); ?></li>
					</ul>
					
					<?php if($session->read('level') == 'dealers' || $session->read('level') == 'admins') : ?>
					<h3>Dealer</h3>
					<ul>
						<li><?php echo $html->link('Ajouter une news', '/posts/add'); ?></li>
						<li><?php echo $html->link('Clients', '/customers') ?></li>
						<li><?php echo $html->link('Factures', '/bills/index') ?></li>
						<li><?php echo $html->link('Ajouter une commande', '/bills/add') ?></li>
						<li><?php echo $html->link('Ajouter un produit', '/products/add') ?></li>
					</ul>
					<?php endif; ?>
					
					<?php if($session->read('level') == 'admins') : ?>
					<h3>Administration</h3>
					<ul>
						<li><?php echo $html->link('Utilisateurs', '/users/knownusers') ?></li>
						<li><?php echo $html->link('Autorisations', '/configs/users') ?></li>
					</ul>
					<?php endif; ?>
				</div>
				<?php endif; ?>
				<hr class="content" />
				
				<div id="footer">
					<?php echo $html->link($html->image('cake.power.png', array('alt' => 'cakephp.org')), 'http://cakephp.org', array(), false, false); ?> 
					<?php echo $html->link($html->image('w3c_xhtml10.png', array('alt' => 'valid xhtml 1.0')), 'http://www.w3.org/html', array(), false, false); ?> 
					<?php echo $html->link($html->image('w3c_css.png', array('alt' => 'valid css')), 'http://www.w3.org/Style/CSS', array(), false, false); ?> 
					<?php echo $html->link($html->image('http://tinymce.sourceforge.net/buttons/tinymce_button.png', array('alt' => 'Powered by TinyMCE')), 'http://tinymce.moxiecode.com?id=powered_by_tinymce_mini', array(), false, false); ?> 
				</div>
			
		</div>
		<?php if(isset($javascript)) : ?>
			<div id="ajax" style="display : none;">&nbsp;</div>
		<?php endif; ?>
		<?php echo $cakeDebug ?>
	</body>
</html>
